<script setup>
import InputText from "../components/InputText.vue";
import InputSelect from "../components/InputSelect.vue";
import Button from "../components/Button.vue";
import IconSvg from "../components/IconSvg.vue";
import Message from "../components/Message/Message.js";
import InfoTable from "../components/InfoTable.vue";
import { ref, onMounted } from "vue"
import axios from "../axios/axios.js";
const code = ref("")
const dataInfo = ref();
const searchCodeInfo = () => {
  if (code.value == "") {
    Message.warn("请输入标识码！");
    return;
  }
  axios.get("/api/info/detail?code=" + code.value).then(res => {
    if (res.data.Code == "200") {
      dataInfo.value = JSON.parse(JSON.stringify(res.data.Data))
    } else {
      Message.error(res.data.Msg)
    }
  })
}
</script>
<template>
  <div class="bg-[white] w-full h-full pt-[40px] px-[40px] text-base flex flex-col">
    <div class="flex justify-center items-center">
      <InputText type="text" label="标识" class="w-[550px] mr-[20px]" v-model="code" />
      <Button type="primary" content="查询" class="mr-[20px]" @click="searchCodeInfo">
        <template #icon>
          <IconSvg name="search" class="w-[18px] h-[18px]"></IconSvg>
        </template>
      </Button>
    </div>
    <div class="mt-[40px] flex-1 overflow-auto">
      <InfoTable title="标识信息" :json-data="dataInfo" nameColumnLabel="信息项" valueColumnLabel="内容" emptyMessage="没有找到信息">
      </InfoTable>
    </div>
  </div>
</template>

<style scoped></style>
